import { Injector } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { MatDialog, MatDialogRef } from '@angular/material';
import { ToasterService } from '../share/services/toaster.service';
import { FormBuilder } from '@angular/forms';

export class AddBase {
	protected dialog: MatDialogRef<any>;
	constructor(
		private inject: Injector,
		protected router = inject.get(Router),
		protected route = inject.get(ActivatedRoute),
		protected toastr = inject.get(ToasterService),
		protected fb = inject.get(FormBuilder),
	) {
		try {
			this.dialog = inject.get(MatDialogRef);
		} catch {}
	}
	cancel() {
		this.dialog.close();
	}
	back() {
		this.router.navigate(['../'], { relativeTo: this.route });
	}
}
